import { Column, Entity, PrimaryGeneratedColumn } from "typeorm";

@Entity("user_message", { schema: "alumni" })
export class UserMessage {
  @PrimaryGeneratedColumn({ type: "int", name: "id", unsigned: true })
  id: number;

  @Column("int", { name: "user_id", unsigned: true, default: () => "'0'" })
  userId: number;

  @Column("int", {
    name: "receiver_id",
    comment: "接收者的id",
    unsigned: true,
    default: () => "'0'",
  })
  receiverId: number;

  @Column("tinyint", {
    name: "type",
    comment: "1:校友联系，2",
    unsigned: true,
    default: () => "'0'",
  })
  type: number;

  @Column("int", {
    name: "target_id",
    comment: "对用的表的id",
    unsigned: true,
    default: () => "'0'",
  })
  targetId: number;

  @Column("varchar", { name: "title", length: 100 })
  title: string;

  @Column("varchar", { name: "content", length: 200 })
  content: string;

  @Column("tinyint", { name: "status", comment: "状态", default: () => "'0'" })
  status: number;

  @Column("int", {
    name: "create_time",
    comment: "发起时间",
    unsigned: true,
    default: () => "'0'",
  })
  createTime: number;
}
